# _*_ coding : utf-8 _*_
# @Time : 2023/11/30 21:29
# @Author : 韩宗森
# @File : 4_urllib_下载
# @Project : pythonProject

import urllib.request

# 下载网页
# url_page = 'https://www.baidu.com/'

# url代表的是下载的路径filename文件的名字
# 在python中可以变量的名字也可以直接写值
# urllib.request.urlretrieve(url_page,'百度.html')

# 下载图片
# url_img = 'https://lmg.jj20.com/up/allimg/1113/042220121425/200422121425-3-1200.jpg'
# urllib.request.urlretrieve(url=url_img, filename='图片.jpg')

# 下载视频
url_video = 'https://vd2.bdstatic.com/mda-pm00h7b3pmndwpbz/sc/h264/1701390087180110891/mda-pm00h7b3pmndwpbz.mp4?v_from_s=hkapp-haokan-hnb&auth_key=1701436067-0-0-9b0a8f862bc6ee14e0d14c4a69927507&bcevod_channel=searchbox_feed&cr=2&cd=0&pd=1&pt=3&logid=0467440040&vid=18259173689232267423&klogid=0467440040&abtest=114240_2-114675_1'
urllib.request.urlretrieve(url=url_video, filename='视频.mp4')
